<?php $controller=$this->controller
        ?>
<div id="sidebar">

    <div class="block">
        <h2>Subpage navigation </h2>
        <ul>
<?php
$subMenu=$this->subMenu;
if (isset ($subMenu)) { foreach ($subMenu as $row){
if (($row['showin_about']==1 )&&($controller=='about')){    ?>
<li><a href="/<?php echo $this->controller.'/sub/page/'.$row['id']; ?>"><?php echo $row['name']; ?></a></li>
<?php }elseif(($row['showin_services']==1 )&&($controller=='services')){ ?>
    <li><a href="/<?php echo $this->controller.'/sub/page/'.$row['id']; ?>"><?php echo $row['name']; ?></a></li><?php }
elseif(($row['showin_news']==1 )&&($controller=='news')){ ?>
    <li><a href="/<?php echo $this->controller.'/sub/page/'.$row['id']; ?>"><?php echo $row['name']; ?></a></li><?php }
}}else { ?><li><a href="/<?php echo $this->controller.'/'; ?>"><?php echo $this->controller; ?></a></li><?php } ?>
        </ul>
    </div>


<?php echo $this->action('testimonials', 'index', 'default'); ?>
<?php echo $this->action('advertise', 'index', 'default'); ?>

</div><!--END sidebar-->